tools/hotplug: Fix hotplug hook script arrangements not to always fail
authorIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 3 Jun 2011 14:04:30 +0000 (15:04 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 3 Jun 2011 14:04:30 +0000 (15:04 +0100)
commit4bf3ca7bdbf89882bfa887f451843192fa275461
treeb9839cf324ca316d5ce2b42b44e2e04f68dcd219
parent46051f0c1cb7428de174d35246dce315493a7cb7
tools/hotplug: Fix hotplug hook script arrangements not to always fail

The new feature introduced in 23401:a44b12ee2fd3 was broken; it in
general always fails, at least if there are no hotplug scripts.

If there are no hooks, call_hooks ends up running this:
  [ -x ".....*.hook" ] && . "..... *.hook"

This does not directly trigger set -e and sigerr.  However, it is the
last command exected in call_hooks.  So the return status of
call_hooks is an error, and thus a sigerr happens when call_hooks
returns.

The bug affects xl and xm.  However xl does not detect failure of the
hotplug script.

Change the script to use if...then rather than &&, as the latter has
very confusing and undesirable semantics.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/hotplug/Linux/xen-hotplug-common.sh